package com.opennews.openplatform.dataaggregatorreactiveservice.controller

import com.opennews.openplatform.dataaggregatorreactiveservice.service.OrderService
import org.springframework.http.ResponseEntity
import org.springframework.http.ResponseEntity.ok
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/orders")
class OrderController(
    private val orderService: OrderService,
) {
    @GetMapping
    suspend fun list(): ResponseEntity<List<Map<String, Any>>> {
        val list = orderService.queryList()

        return ok(list);
    }
}